package main

import (
	"context"
	"encoding/json"
	"fmt"
	"gitee.com/leo-xin/novel_distribution_sdk_go/changdu"
	"gitee.com/leo-xin/novel_distribution_sdk_go/changdu/config"
	"io"
)

func promotionListV1Example() {

	ctx := context.Background()

	configuration := config.NewConfiguration()
	apiClient := changdu.Init(configuration)

	resp, httpRes, err := apiClient.PromotionListV1Api().
		Get(ctx).
		SecretKey(SecretKey).
		DistributorId(DistributorId).Offset(0).Limit(1).
		Execute()

	s, _ := json.Marshal(resp)
	fmt.Println(string(s))

	resBytes, _ := io.ReadAll(httpRes.Body)
	fmt.Println(string(resBytes))
	fmt.Println(err)

}
